<?php

/**
 * 验证码处理
 */
namespace Api\Controller;
use Think\Controller;
class CourseController extends Controller {	
    //登录验证
    function lists(){
    	$url = sp_get_host();    	
    	$course_model=M("Course");       	
		//dump($mobile);		
		$data = $course_model->order('cs_addtime desc')->limit(8)->select();
		//dump($data);
		foreach($data as $n=> $val){
	    	$data[$n]['cs_picture']=$url.$data[$n]['cs_picture']; //妥妥的加上域名了
			$data[$n]['cs_brief']=strip_tags($data[$n]['cs_brief']);
		}
		if(!empty($data)){            
                //$_SESSION["user"]=$result;
                //写入此次登录信息
				//$data1['cs_tu'] = 'http://211.142.183.74:8585/'.$data['cs_picture'];
				//$data1['cs_name'] = $data['cs_name'];
				//$data1['cs_addtime'] = $data['cs_addtime'];
				//$data1['cs_brief'] = $data['cs_brief'];
                $this->ajaxReturn($data,'json');           
        }	
    }
}

